package com.ruoyi.dataserver.line.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum LineFieldEnum {

    BSM("BSM","BSM","标识码"),
    DM("DM","DM","代码"),
    QDDH("QDDH","QDDH","起点点号"),
    ZDDH("ZDDH","ZDDH","终点点号"),
    QDGC("QDGC","QDGC","起点高程"),
    ZDGC("ZDGC","ZDGC","终点高程"),
    QDMS("QDMS","QDMS","起点埋深"),
    ZDMS("ZDMS","ZDMS","终点埋深"),
    MSLX("MSLX","MSLX","埋设类型"),
    CZ("CZ","CZ","材质"),
    GJ("GJ","GJ","管径"),
    DYZ("DYZ","DYZ","电压值"),
    YL("YL","YL","压力"),
    LX("LX","LX","流向"),
    ZKS("ZKS","ZKS","总孔数"),
    ZYKS("ZYKS","ZYKS","占用孔数"),
    DLTS("DLTS","DLTS","电缆条数"),
    BHCZ("BHCZ","BHCZ","保护材质"),
    XX("XX","XX","线型"),
    GXFLDM("GXFLDM","GXFLDM","管线分类代码"),
    SZDL("SZDL","SZDL","所在道路"),
    QSDW("QSDW","QSDW","权属单位"),
    JSND("JSND","JSND","建设年代"),
    TCDW("TCDW","TCDW","探测单位"),
    TCRQ("TCRQ","TCRQ","探测日期"),
    SYZT("SYZT","SYZT","使用状态"),
    BZ("BZ","BZ","备注"),
    US_ID("US_ID","US_ID","US_ID"),
    ;



    private String code;
    private String fieldName;
    private String description;

    public static LineFieldEnum getLineFieldEnumWithCode(String code){
        if (code == null || code.isEmpty()){
            return null;
        }
        for (LineFieldEnum lineFieldEnum : LineFieldEnum.values()) {
            if (code.equals(lineFieldEnum.getCode())){
                return  lineFieldEnum;
            }
        }
        return null;
    }
}
